﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Core.Email
{
	using Falcon.Core.Domain;
	using Falcon.Core.Extensions;

	public class UserFriendshipRequestEmail : IEmail
	{
		/// <summary>
		/// Gets or sets the template.
		/// </summary>
		/// <value>The template.</value>
		public string Template
		{
			get
			{
				return Settings.Templates.UserFriendshipRequest;
			}
		}

		/// <summary>
		/// Gets or sets to.
		/// </summary>
		/// <value>To.</value>
		public string To
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets from.
		/// </summary>
		/// <value>From.</value>
		public string From
		{
			get
			{
				return Settings.Email;
			}
		}

		/// <summary>
		/// Gets the subject.
		/// </summary>
		/// <value>The subject.</value>
		public string Subject
		{
			get
			{
				return Resources.Email.UserFriendshipRequest.Fmt(Settings.Title);
			}
		}

		/// <summary>
		/// Gets the site URL.
		/// </summary>
		/// <value>The site URL.</value>
		public string SiteUrl
		{
			get
			{
				return Settings.Url;
			}
		}

		/// <summary>
		/// Gets the site title.
		/// </summary>
		/// <value>The site title.</value>
		public string SiteTitle
		{
			get
			{
				return Settings.Title;
			}
		}

		/// <summary>
		/// Gets or sets the name.
		/// </summary>
		/// <value>The name.</value>
		public string Name
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the sender.
		/// </summary>
		/// <value>The sender.</value>
		public string Sender
		{
			get;
			set;
		}

		/// <summary>
		/// Builds this instance.
		/// </summary>
		/// <returns></returns>
		public object Build()
		{
			return new
			{
				name = Name,
				sender = Sender,
				siteUrl = SiteUrl,
				siteTitle = SiteTitle
			};
		}
	}
}